package com.csl.ws.hotel.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.csl.ws.hotel.service.HandlerService;

public class ContextUtil {
	private static ApplicationContext appCtx = null;  
    private ContextUtil(){  
        appCtx = new ClassPathXmlApplicationContext("classpath:src/beans.xml");  
    }  
  
    public static ApplicationContext getAppCtx() {  
        return appCtx;  
    }  
	public static void main(String[] args) {
		ApplicationContext ctx=new ClassPathXmlApplicationContext("beans.xml");
		HandlerService handlerService=(HandlerService) ctx.getBean("handlerService");
		System.out.println(handlerService);
	}

}
